<?php

class JF_Layout {

	private $sLayout;

	private $sView;

	private $aView;

	public function __construct($sLayout, $sView, array $aView) {
		$this->sLayout 	= $sLayout;
		$this->sView	= $sView;
		$this->aView	= $aView;
	}

	public function render() {
		JF_RenderUtil::renderLayout($this->sLayout, $this);
	}

	public function loadCurrent() {
		JF_RenderUtil::renderView($this->sView, $this->aView);
	}

	public function loadPartial($sComponent, $sPartClassname) {
		$sPartSource = 'component/' . $sComponent . '/controller/' . ucfirst($sPartClassname) . 'PartialController.php';
		JF_ReflectionUtil::newInstance($sPartSource, array(), 'JF_IPartialController')->execute();
	}

	public function loadStatic($sSource) {
		echo JF_FileUtil::read($sSource);
	}

}